package singles

import (
	"github.com/go-resty/resty/v2"
	"showurl/static-file/kplayer/apis/config"
	httpUtils "showurl/static-file/kplayer/apis/utils/http"
)

type RespGetRunTime struct {
	RunTime float64 `json:"run_time"`
}

func GetRunTime() *RespGetRunTime {
	resp := &RespGetRunTime{}
	httpUtils.ParseResponseJsonBody(func(r *resty.Request) (*resty.Response, error) {
		return r.Get(config.Host + `/v1.1/player/run-time`)
	}, resp)
	return resp
}

/*
{
    "run_time": 6317.042751
}
*/
